<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap js-check-wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">幻灯片页面管理</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li><a href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">幻灯片页面列表</a></li>
                                <li><a href="{:url('SlideItem/add',['slide_id'=>$slide_id])}">添加幻灯片页面</a></li>
                                <li class="layui-this"><a href="{:url('SlideItem/edit',['slide_id'=>$slide_id])}">编辑幻灯片页面</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form action="{:url('SlideItem/editPost')}" method="post" class="layui-form js-ajax-form">
                                        <table class="layui-table">
                                            <tr>
                                                <th>标题<span style="color:#FF5722;">*</span></th>
                                                <td>
                                                    <input class="layui-input" type="text" style="width:400px;" name="post[title]" id="title" required value="{$result.title}" placeholder="请输入标题" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>链接</th>
                                                <td>
                                                    <input class="layui-input" type="text" name="post[url]" id="keywords" value="{$result.url}" style="width: 400px" placeholder="请输入链接">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>描述</th>
                                                <td><input class="layui-input" type="text" name="post[description]" id="source" value="{$result.description}" style="width: 400px" placeholder="请输入描述"></td>
                                            </tr>
                                            <tr>
                                                <th>幻灯片内容</th>
                                                <td>
                                                    <textarea class="layui-textarea" name="post[content]" id="description" style="width: 47%; height: 100px;" placeholder="请填写幻灯片内容">{$result.content}</textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th><b>缩略图</b></th>
                                                <td>
                                                    <div>
                                                        <input type="hidden" name="post[image]" id="thumb" value="{$result.image|default=''}">
                                                        <a href="javascript:uploadOneImage('图片上传','#thumb');">
                                                            <if condition="empty($result['image'])">
                                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand" />
                                                                <else />
                                                                <img src="{:cmf_get_image_preview_url($result['image'])}" id="thumb-preview" width="135" style="cursor: hand" />
                                                            </if>
                                                        </a>
                                                        <input type="button" class="layui-btn layui-btn-xs" onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片">
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                        <div class="layui-form-item layui-layout-admin">
                                            <div class="layui-input-block">
                                                <div class="layui-footer" style="left:0;">
                                                    <input type="hidden" name="post[id]" value="{$result.id}" />
                                                    <input type="hidden" name="post[slide_id]" value="{$slide_id}">
                                                    <button type="submit" class="layui-btn layui-btn js-ajax-submit">{:lang('SAVE')}</button>
                                                    <a class="layui-btn layui-btn-primary" href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">{:lang('BACK')}</a>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    </div>
    <include file="public@footer" />
</body>

</html>